package com.itheima.个人代码.IO流2;

import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class Demo8 {
    public static void main(String[] args) throws IOException {
        ArrayList<Student> list=new ArrayList<>();
        Collections.addAll(list,new Student("zhangsan",22,'男'),new Student("lsii",21,'男'),new Student("小花",33,'女'),new Student("麻六",32,'男'));
        FileWriter fw=new FileWriter("IO流2和对象操作流properties\\student.txt");


        fw.close();

    }
}


class Student {
    private String name;
    private int age;
    private char sex;

    public Student() {
    }

    public Student(String name, int age, char sex) {
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    @Override
    public String toString() {
        return "姓名: " + this.name + "   年龄: " + this.age + "    性别: " + this.sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }


}